<?php
$cs = Yii::app()->clientScript;
$cssCoreUrl = $cs->getCoreScriptUrl();
$cs->registerCoreScript('jquery.ui');
$cs->registerCssFile($cssCoreUrl . '/jui/css/base/jquery-ui.css');
$cs->registerScriptFile(BASE_URL . '/js/jquery_plus/jquery.form.js', CClientScript::POS_END);
$cs->registerScriptFile(BASE_URL . '/js/jquery_plus/qTip/jquery.qtip.min.js', CClientScript::POS_END);
$cs->registerCssFile(BASE_URL . '/js/jquery_plus/qTip/jquery.qtip.min.css');
$this->menu = array(
	array('label'=>'导航管理列表', 'url'=>array('admin')),
);
if(!empty($model['_id'])){
	$this->menu[] = array('label'=>'新建导航组', 'url'=>array('Edit'));
}
?>
<h2><a href="/manage/navigation/admin">导航管理列表</a> > 导航编辑</h2>
<?php 
$this->beginWidget('CActiveForm', array(
	'id'			=> 'navigation_form',
	'htmlOptions' 	=> array('class'=>'setting_form'),
));
?>
	<div class="setting_nav"></div>
	<dl class="setting_content">
		<dt>基本信息</dt>
		<dd>
			<strong>导航组名称：</strong>
			<?php echo YHtml::activeTextField($model, 'title', array('model'=>'Nav', 'rule'=>'^.{1,50}$', 'next_focus'=>''))?>
			<p>仅用于备注，建议使用简洁明了的名称</p>
		</dd>
		<dd>
			<strong>导航组代码：</strong>
			<?php echo YHtml::activeTextField($model, 'code', array('model'=>'Nav', 'rule'=>'^[_|a-z|A-Z|0-9]{1,20}$', 'next_focus'=>''))?>
			<p>用于模块调用，请使用字母、数字及下划线，不可重复</p>
		</dd>
		<dd>
			<strong>说明：</strong>
			<?php echo YHtml::activeTextArea($model, 'remark', array('model'=>'Nav', 'id'=>false, 'class'=>'nav_remark'))?>
		</dd>
		<dt>导航内容</dt>
		<dd>
			<?php 
			$this->renderPartial('_nav_item', array(
				'items' => isset($items) ? $items : null,
				'thumb'	=> '100x100',
				'parent'=> '',
			));
			?>
		</dd>
		<dt>添加导航</dt>
		<dd class="add_item">
			<ul>
				<li>
					<?php 
					$this->widget('manage.widget.UploaderWidget',array(
						'has_main_picture' 	=> false, 
						'pictures' 			=> null,
						'thumb'				=> '100x100',
						'tpl'				=> 'simple',
						'id'				=> 'nav_uploader',
						'default_onload_js'	=> 'y_on_uploaded_nav'
					));
					?>
					<p>（点击添加图片导航）</p>
				</li>
				<li>
					<a href="javascript:void(0)" id="add_text_nav">点击添加文字导航</a>
				</li>
			</ul>
		</dd>
	</dl>
	<div id="next_content" class="ext_content">
		<h6>添加子导航</h6>
		<a href="javascript:void(0)" class="back_btn"></a>
		<div class="ext_main_body"></div>
		<div class="buttons">
			<input type="button" class="button back_btn" value="返回"/>
			<input type="button" class="button add_sub_nav" value="添加子导航"/>
		</div>
	</div>
	<div class="buttons right">
		<?php echo YHtml::activeHiddenField($model, '_id', array('model'=>'Nav'))?>
		<input type="button" class="button save_btn" value="保存"/>
	</div>
<?php $this->endWidget(); ?>